﻿using UnityEngine;
using System.Collections;

public class text_from_door : MonoBehaviour 
{
	public static bool show_text;
	public static bool show_text_time;
	public static bool allRecharge;
	public float allCooldownTime = 0.0f;
	private float allCooldownRecharg = 3f;

	
	
	void Update() 
	{
		Show_text_time ();
		//Debug.Log(show_text_time + " nnnn " +  allCooldownTime );
		if(show_text)
		{
			Showtext();
		}	
	}
	
	void Showtext()
	{
		renderer.enabled = true;
		show_text = false;
		Show_text_time();
	}
	
	void Show_text_time()
	{
		allCooldownTime += Time.deltaTime;	
			
		if(allCooldownTime > allCooldownRecharg)
		{
			allCooldownTime = 0;
			show_text_time = false;
			renderer.enabled = false;
		}	
	}	
	
	
}
